//
//  BlueButton.m
//  TestARC
//
//  Created by wuxiaoquan on 12-11-8.
//
//

#import "BlueButton.h"

@implementation BlueButton

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

- (id)init {
    if(self = [super init]) {
        self.frame = CGRectMake(0, 0, 30.0, 30.0);
        self.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
        self.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        
        UIImage *image = [UIImage imageNamed:@"welcome_y_logo.png"];
        UIImage *stretchImage = [image stretchableImageWithLeftCapWidth:0.0 topCapHeight:0.0];
        [self setBackgroundImage:stretchImage forState:UIControlStateNormal];
        
        self.backgroundColor = [UIColor clearColor];
        [self setTitleShadowColor:[UIColor blackColor] forState:UIControlStateNormal];
        
        // 设置圆角半径
        self.layer.masksToBounds = YES;
        self.layer.cornerRadius = 5;
        
        //还可设置边框宽度和颜色
        self.layer.borderWidth = 1;
        self.layer.borderColor = [UIColor darkGrayColor].CGColor;
        self.layer.shadowColor = [UIColor darkGrayColor].CGColor;
    }
    
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
